package com.jt.tenant.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.AsyGet;
import com.zcx.helper.http.note.HttpServer;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/1/30.
 */
@HttpServer(Conn.WEB_SERVICE)
public class JTAsyGet<T> extends AsyGet<T> {

    public JTAsyGet(AsyCallBack<T> asyCallBack) {

        super(asyCallBack);

    }

    @Override
    protected T parser(JSONObject object) {

        JSONObject apiTYF = object.optJSONObject("apiTYF");

        JSONObject head = apiTYF.optJSONObject("head");

        TOAST = head.optString("msg");

        return head.optString("code").equals("10000") || head.optString("code").equals("10001") ? parserBody(apiTYF.opt("body")) : null;

    }

    protected T parserBody(Object body){

        return null;

    }

}
